package com.qzsoft.zhjd.machine.zhgcloud.realtime.model;

import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName ZhgRealtimeDataModel
 * @Description 机械设备
 * @author linhuawei
 * @since 2021-11-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
public class ZhgRealtimeDataModel {

    /**
     * 机械状态
     */
    private String state;

    /**
     * 终端状态
     */
    private String device_state;

    /**
     * 机械状态持续时间
     */
    private Integer standing_time;

    /**
     * 机械状态上报时间
     */
    private Long state_update_at;

    /**
     * 当前位置
     */
    private String address;

    /**
     * 经度
     */
    private BigDecimal longitude;

    /**
     * 纬度
     */
    private BigDecimal latitude;

    /**
     * 最后定位时间
     */
    private Long last_location_at;

    /**
     * 硬件设备信息
     */
    private ZhgRealtimeDeviceModel device;

    public Date getStateUpdateAt() {
        return new Date(state_update_at * 1000L);
    }

    public Date getLastLocationAt() {
        return new Date(last_location_at * 1000L);
    }

}
